package com.repeat.member.controller;

import com.repeat.member.model.Merchants;
import com.repeat.member.service.MerchantService;
import com.shop.common.response.ExceptionResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("merchant")
public class MerchantController {
    @Autowired
    private MerchantService merchantService;
    @GetMapping("hotMerchant")
    public ResponseEntity<ExceptionResponse> hotMerchant(@RequestParam(defaultValue = "1") int pageNum, @RequestParam(defaultValue = "10") int pageSize) {
       List<Merchants> merchants = merchantService.merchantsHot(pageNum,pageSize);
        return ResponseEntity.ok(ExceptionResponse.Success(merchants));
    }
}
